/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ihm_clarifiee.Control;

import ihm_clarifiee.application.Backlog;
import ihm_clarifiee.application.Histoire;
import ihm_clarifiee.application.Projet;
import ihm_clarifiee.Presentation.PBacklog;

/**
 *
 * @author Arthur
 */
public class CBacklog extends Backlog{
    
    private PBacklog pres;
    
    public CBacklog(Projet p){
       super(p);
       pres = new PBacklog(this);
    }
   /*
    public Histoire getHistoire(int i){
        Histoire temp = super.getHistoire(i);
        return temp;
    }
    
    public void addHistoire(Histoire hist){
        super.addHistoire(hist);
    }
    */
    public PBacklog getPresentation(){
        return pres;
    }
   
    public void upPrioHistoire(int i){
       if (i<super.getTaille()&&i>0){
           Histoire hist = super.getHistoire(i);
           Histoire temp = super.getHistoire(i-1);
           super.setHistoire(hist, i-1);
           super.setHistoire(temp, i);
       }
    }
    
    public void downPrioHistoire(int i){
       if (i<super.getTaille()-1&&i>=0){
           Histoire hist = super.getHistoire(i);
           Histoire temp = super.getHistoire(i+1);
           super.setHistoire(hist, i+1);
           super.setHistoire(temp, i);
       }
    }
    
    public void removeHistoire(int i){
      /*  if (i<super.getTaille()&&i>=0){
            for(int j = i; j<super.getTaille()-1; j++){
                super.setHistoire(super.getHistoire(j+1), j);
            }
            
            super.setTaille(super.getTaille()-1);
        }*/
        super.supprimerHistoire(i);
    }   
    
    
}
